FROM registry.cn-chengdu.aliyuncs.com/food_security/base_nodejs_docker:latest

WORKDIR /app

COPY . .


RUN rm -rf node_modules \
    && rm -rf assets \
    && mkdir -p assets/temp/doc \
    && mkdir -p assets/temp/image \
    && mkdir -p assets/temp/down \
    && mkdir -p assets/temp/upload \
    && mkdir -p assets/temp/pdf

RUN apk --no-cache add libc6-compat

RUN apk --no-cache add libreoffice libreoffice-writer imagemagick ghostscript

RUN npm config set registry https://mirrors.cloud.tencent.com/npm/

RUN npm install

RUN npm run build

RUN mv /app/fonts/* /usr/share/fonts/ && fc-cache -f -v /app/fonts/ && fc-list

EXPOSE 3000

CMD ["npm","run", "start:prod"]
